package main.testers;

import java.util.List;

import modules.dimensioning.solution.SplitSolutions;

import org.geotools.geometry.jts.JTSFactoryFinder;

import tools.gis.antennaReader.AntennaSite;
import tools.gis.antennaReader.AntennaSiteReader;

import com.vividsolutions.jts.geom.Polygon;
import com.vividsolutions.jts.io.WKTReader;

import datatypes.Antenna;
import java.io.File;

public class SplitSolutionTester {
	//SETTINGS
	static Polygon area;
	static int generations = 8000;
	static int population = 50;
	static boolean showOutput = true;
	static int timeInMs = 3600000;
	
	/**	
	 * Currently uses dummy calsses of legislation, coverage and antennareader.
	 * 
	 * This is currently the main test class 
	 * @param args
	 */
	public static void main(String[] args) {
		try {
			//reading antennas
            AntennaSiteReader areader = new AntennaSiteReader();
            List<AntennaSite> list = areader.getAntennaSiteList(new File("C:\\Bipt antennes Brussels hoofdstedelijk gewest v2.shp"));
            Antenna[] antennas = areader.filterSiteListGUI(list);
			
			com.vividsolutions.jts.geom.GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory( null );
			WKTReader reader = new WKTReader( geometryFactory );
			
			area = (Polygon) reader.read("POLYGON ((144042.48559719793 173606.71120400354, 145376.15065514395 175940.6250549974, 146471.66123831345 176750.35026868526, 149329.51493333897 177321.9210080281, 150472.65641117148 176178.77953022998, 151520.53609959723 178322.16980151553, 153139.9865267724 178607.9551712107, 153711.55726556483 177083.76653402857, 154568.91337396926 176464.56490025297, 154473.651584014 175511.94700194895, 154997.59142799504 174797.48357829824, 154235.49710913812 173225.66404601466, 153330.51010573193 173178.0331509821, 153521.03368534564 172796.9859916875, 154616.54426835326 172368.3079375988, 155521.53127176553 172463.5697275456, 155616.79306147975 171558.58272417728, 156950.458119115 171510.9518294325, 156950.45811868724 168224.4200802939, 153282.87920969553 164556.8411713224, 155188.11500610886 162889.75984952133, 153949.71173824323 162461.08179511875, 152282.6304164207 164223.42490678, 151091.85804334 162794.49805915356, 151615.7978872711 161698.9874761589, 150710.81088384625 161508.46389637515, 149901.08567038336 162318.1891098395, 147900.588083907 162222.92731974553, 145709.5669181192 164842.6265398292, 145804.82870813 166223.9224923905, 143566.17664715895 166795.49323108234, 142137.24979962152 166319.18428174593, 141756.20264055295 168319.6818681406, 143042.2368033186 168605.46723780222, 143566.1766477132 171082.273773456, 144471.16365112716 171177.5355634028, 144280.6400715869 172130.1534616761, 143137.4985937163 172987.5095699951, 144042.48559719793 173606.71120400354))");
			

			
			SplitSolutions ss = new SplitSolutions();
			ss.generatePartialSolutions(antennas,area, 3, 3);
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
